import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const EnforcementManagementMeta: IPublicTypeComponentMetadata = {
  componentName: 'EnforcementManagement',
  title: '执法管理',
  category: '基础组件',
  group: '通用组件',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'EnforcementManagement',
    main: 'src/index.tsx',
    destructuring: true,
    subName: ''
  },
  props: [
    {
      name: 'ref',
      propType: 'object',
    },
    {
      name: 'key',
      propType: 'string',
    },
    {
      name: 'style',
      propType: 'object',
    },
  ],
  configure: {
    props: [
      // 组件大小配置
      {
        type: 'group',
        display: 'accordion',
        title: {
          label: '组件大小配置',
        },
        items: [
          {
            name: 'componentWidth',
            title: {
              label: '组件宽度',
              tip: '组件宽度(px)'
            },
            setter: 'NumberSetter',
          },
          {
            name: 'componentHeight',
            title: {
              label: '组件高度',
              tip: '组件高度(px)'
            },
            setter: 'NumberSetter',
          },
        ]
      },
      // 标签配置
      {
        name: 'label',
        type: 'group',
        display: 'accordion',
        title: {
          label: '一级标签配置',
        },
        items: [
          {
            name: 'label',
            title: {
              label: '标签文字',
              tip: '显示的标签文字'
            },
            setter: 'StringSetter',
          },
          {
            name: 'labelFontSize',
            title: {
              label: '标签字体大小',
              tip: '标签文字字体大小(px)'
            },
            setter: 'NumberSetter',
          },
          {
            name: 'labelColor',
            title: {
              label: '标签颜色',
              tip: '标签文字颜色'
            },
            setter: 'ColorSetter',
          }
        ]
      },
      // 二级标签配置
      {
        name: 'labelSen',
        type: 'group',
        display: 'accordion',
        title: {
          label: '二级标签配置',
        },
        items: [
          {
            name: 'labelSen',
            title: {
              label: '标签文字',
              tip: '显示的标签文字'
            },
            setter: 'StringSetter',
          },
          {
            name: 'sendlabelFontSize',
            title: {
              label: '标签字体大小',
              tip: '标签文字字体大小(px)'
            },
            setter: 'NumberSetter',
          },
          {
            name: 'sendlabelColor',
            title: {
              label: '标签颜色',
              tip: '标签文字颜色'
            },
            setter: 'ColorSetter',
          }
        ]
      },
      // 数字配置
      {
        name: 'count',
        type: 'group',
        display: 'accordion',
        title: {
          label: '数字配置',
        },
        items: [
          {
            name: 'count',
            title: {
              label: '数字配置',
              tip: '显示的人数数值'
            },
            setter: 'NumberSetter',
          },
          {
            name: 'countFontSize',
            title: {
              label: '数字大小',
              tip: '数字字体大小(px)'
            },
            setter: 'NumberSetter',
          },
          {
            name: 'countColor',
            title: {
              label: '数字颜色',
              tip: '数字颜色'
            },
            setter: 'ColorSetter',
          }
        ]
      },
    ],
    supports: {
      style: true,
      className: true,
      events: ['onClick']
    }
  }
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '执法管理',
    screenshot: '',
    schema: {
      componentName: 'EnforcementManagement',
      props: {
        componentWidth: 156,
        componentHeight: 52,
        label: '交警',
        labelFontSize: 14,
        labelColor: 'rgba(255,255,255,0.8)',
        labelSen: '出动警力',
        sendlabelFontSize: 12,
        sendlabelColor: '#43AAFF',
        count: 125,
        countFontSize: 20,
        countColor: '#ffffff',
        textSize: 16,
        numberSize: 28,
        textColor: '#FFFFFF',
        numberColor: '#1AD7FF',
        textWeight: '400',
        numberWeight: 'bold',
        direction: 'vertical',
        align: 'left',
        spacing: 8,
        style: {
          fontFamily: 'SourceHanSansSC, DINAlternate'
        }
      }
    }
  }
];

export default {
  ...EnforcementManagementMeta,
  snippets,
};
